package com.valinor.ws.cxfservice;
 
import javax.jws.WebService;

import net.webservicex.ConversionRate;
import net.webservicex.ConversionRateResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ws.client.core.WebServiceTemplate;
import org.springframework.ws.transport.http.HttpComponentsMessageSender;
import org.springframework.ws.soap.client.core.SoapActionCallback;


 
@WebService(endpointInterface="com.valinor.ws.cxfservice.Service")
public class ServiceImpl implements Service {
 
    @Autowired 
    public WebServiceTemplate webServiceTemplate;
    
    public String testingWS(String input) {
        
        return "Hola: "+input;
    }
    
    public int testingWS2(int input){
        
        
        return 10*input;
    }

    public ConversionRateResponse testingWS3(ConversionRate conversionRate) {
        // TODO Auto-generated method stub
        
        
        ConversionRateResponse response = (ConversionRateResponse) webServiceTemplate.marshalSendAndReceive(conversionRate, new SoapActionCallback(""));
        
        
        return response;
    }
    
}